using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using QLKS.DataLayer.BusinessObjects;
using QLKS.DataLayer.Base;

namespace QLKS.DataLayer.ManagerObjects
{
    public partial interface IKhachHangManager : IManagerBase<KhachHang, int>
    {
		// Get Methods
		IList<KhachHang> GetByMaLoaiKhach(System.Int32 loaiKhach);
    }

    partial class KhachHangManager : ManagerBase<KhachHang, int>, IKhachHangManager
    {
		#region Constructors
		
		public KhachHangManager() : base()
        {
        }
        public KhachHangManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<KhachHang> GetByMaLoaiKhach(System.Int32 loaiKhach)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(KhachHang));
			
			
			ICriteria loaiKhachCriteria = criteria.CreateCriteria("LoaiKhach");
            loaiKhachCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", loaiKhach));
			
			return criteria.List<KhachHang>();
        }
		
		#endregion
    }
}